<template>
	<div>
		<button @click="a = !a">显示/隐藏</button>
		<transition>
			<h1 v-if="a">你好</h1>
		</transition>
	</div>
</template>

<script>
	export default {
		name:'App',
		data() {
			return {
				a:true
			}
		},
	}
</script>

<style>
	h1{
		background-color: orange;
		transition: 1s linear;
	}
	.v-leave,.v-enter-to{
		transform: translateX(0px);
	}
	.v-leave-to,.v-enter{
		transform: translateX(-100%);
	}
</style>